import request from '@/utils/request'

// 查询推广员列表
export function listExtensionWorker(query) {
  return request({
    url: '/popularize/popularize/worker',
    method: 'get',
    params: query
  })
}

// 新增推广员
export function addExtensionWorker (data) {
  return request({
    url: `/popularize/popularize/worker`,
    method: 'post',
    data: data
  })
}

// 修改推广员
export function updateExtensionWorker (id, data) {
  return request({
    url: `/popularize/popularize/worker/${id}`,
    method: 'put',
    data: data
  })
}


// 查询推广订单列表
export function listExtensionWorkerOrder(query) {
  return request({
    url: '/popularize/popularize/worker/orders/page',
    method: 'get',
    params: query
  })
}

// 审核提现订单
export function reviewExtensionWorkerOrder (id, extensionWorkerOrderId, data) {
  return request({
    url: `/popularize/popularize/worker/${id}/orders/${extensionWorkerOrderId}/withdrawalStatus`,
    method: 'put',
    data: data
  })
}
